package info.cs52.fes.lp;

import info.cs52.xdao.PhrasePatternXDAO;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.List;

public abstract class LanguageParser {
	
	public static List<PhrasePattern> ANSWER_PATTERNS = PhrasePatternXDAO.fetchAnswerPatterns();
	
	protected String originalPhrase;
	protected String translatedPhrase;
	
	protected String meaning; //not string? sth else
	
	protected List<PhrasePattern> defaultPattern;
	protected int errorCode = 0;//no error
	
	protected int phraseType = 0; //question, define, control,... // =0 is unknown type
	
	public final int ERR_NTT = 1;//nothing to translate
	public final int ERR_DUP = 2;//dont understand phrase
	
	public final int TYPE_CMD = 11;
	public final int TYPE_MSG = 12;
	public final int TYPE_NUMBER = 13;
	
	
	public LanguageParser() {
		// TODO Auto-generated constructor stub
	}
	public LanguageParser(String phrase){
		setOriginalPhrase(phrase);
	}
	
	public void parse() throws IOException{}
	
	public String getOriginalPhrase() {
		return originalPhrase;
	}
	public void setOriginalPhrase(String originalPhrase) {
		this.originalPhrase = originalPhrase;
	}
	public int getPhraseType() {
		return phraseType;
	}
	public void setPhraseType(int phraseType) {
		this.phraseType = phraseType;
	}
	public String getTranslatedPhrase() {
		return translatedPhrase;
	}
	public int getErrorCode() {
		return errorCode;
	}
	public List<PhrasePattern> getDefaultPattern() {
		return defaultPattern;
	}
	public void setDefaultPattern(List<PhrasePattern> defaultPattern) {
		this.defaultPattern = defaultPattern;
	}
	
	
}
